import request from '../axios'
// 列出某人所有的药店
export function listSchool () {
  const url = '/api/school/list'
  return request.get(url)
}

// 列出某人所有的药店
export function listSchoolByUserId (userId) {
  const url = '/api/school/list/user'
  const params = { userId }
  return request.get(url, { params })
}

// 列出某线路的药店
export function listSchoolByRoute (routeId) {
  const url = '/api/school/route'
  const params = { routeId }
  return request.get(url, { params })
}

// 获取学校
export function getSchool (id) {
  const url = '/api/school/id?id=' + id
  return request.get(url)
}

// 获取学校
export function addSchool (school) {
  const url = '/api/school/add'
  const data = {
    ...school
  }
  data.json = true
  data.Loading = true
  return request.post(url, data)
}
